For some reason I am unable to paste an OLE into a RichText box and then get the richText and store it into the object text. I am using DOORS 8.3. The relevant code is: string sObjectText sObjectText = get(dbeNonRequirementText) o."Object Text" = richText(sObjectText)
David_G_Bond - Thu May 20 17:25:43 EDT 2010 |
Re: Problem getting OLE pasted into richText box into the Object Text
Hi
DBE rt
DB db = create("test")
void procCopy(DB win)
{
Object o = current
if ( !null(o) )
{
set(rt, o."Object Text")
}
}
void procPaste(DB win)
{
Object o = current
if ( !(null(o)) )
{
get(rt, o."Object Text")
}
}
rt = richText(db, "Test of object update", "", 300, 250, false)
apply(db, "Copy", procCopy)
apply(db, "Paste", procPaste)
show(db)
|
Re: Problem getting OLE pasted into richText box into the Object Text Hmm, this should work. I scribbled together a complete script as follows:
DB baseDB
DBE richTextDBE
void pasteIntoObjectText(DB db)
{
string s = get(richTextDBE)
Object o = current Object
o."Object Text" = richText s
refresh current Module
}
baseDB = create "Paste into Object Text"
richTextDBE = richText(baseDB, "", "", 400, 200, false)
apply(baseDB, pasteIntoObjectText)
show baseDB
and it does paste OLE objects into the Object Text. Maybe you can post your complete code, or at least a working script which fails to paste the OLE objects? |
Re: Problem getting OLE pasted into richText box into the Object Text Peter_Albert - Fri May 21 02:58:52 EDT 2010 Hmm, this should work. I scribbled together a complete script as follows:
DB baseDB
DBE richTextDBE
void pasteIntoObjectText(DB db)
{
string s = get(richTextDBE)
Object o = current Object
o."Object Text" = richText s
refresh current Module
}
baseDB = create "Paste into Object Text"
richTextDBE = richText(baseDB, "", "", 400, 200, false)
apply(baseDB, pasteIntoObjectText)
show baseDB
and it does paste OLE objects into the Object Text. Maybe you can post your complete code, or at least a working script which fails to paste the OLE objects?
|
Re: Problem getting OLE pasted into richText box into the Object Text a_vestlin - Fri May 21 02:58:18 EDT 2010
Hi
DBE rt
DB db = create("test")
void procCopy(DB win)
{
Object o = current
if ( !null(o) )
{
set(rt, o."Object Text")
}
}
void procPaste(DB win)
{
Object o = current
if ( !(null(o)) )
{
get(rt, o."Object Text")
}
}
rt = richText(db, "Test of object update", "", 300, 250, false)
apply(db, "Copy", procCopy)
apply(db, "Paste", procPaste)
show(db)
Fixed. This works. Notice the richTextWithOle, assigning from get, and refresh module.
DBE rt
DB db = create("test")
Module mod = current
void procCopy(DB win)
{
Object o = current
if ( !null(o) )
{
set(rt, richTextWithOle(o."Object Text"))
}
}
void procPaste(DB win)
{
Object o = current
if ( !(null(o)) )
{
o."Object Text" = richText(get(rt))
refresh(mod)
}
}
rt = richText(db, "Test of object update", "", 300, 250, false)
apply(db, "Copy", procCopy)
apply(db, "Paste", procPaste)
show(db)
|
Re: Problem getting OLE pasted into richText box into the Object Text David_G_Bond - Fri May 21 10:38:21 EDT 2010
I've never run into a situation where a large script effectively corrupts itself due to its size; and I've got some whopping scripts. Thus, there is something wrong with your script. If this were me, I'd do these things: [1] Turn on OLE in History (database parameter), run the script, then check Object Text History. [2] Look for corruption of your richText DBE variable. Perhaps DBE rtTemp = MyRichTextBox right after you define MyRichTextBox = richText(...), then check it again after your assignment statement. [3] Be sure you are actually assigning to the right Object; assigning to the 'current' Object is potentical disaster. Dump the Identifier of the object getting its Text updated. [3] Be sure to refresh(module(obj)); MAYBE you are just not seeing the update.
|
Re: Problem getting OLE pasted into richText box into the Object Text David_G_Bond - Fri May 21 10:38:21 EDT 2010
Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS |
Re: Problem getting OLE pasted into richText box into the Object Text Mathias Mamsch - Fri May 21 14:20:46 EDT 2010 Mathias Mamsch, IT-QBase GmbH, Consultant for Requirement Engineering and D00RS
|